//
//  RMMPayJieGuoViewController.m
//  Romomo
//
//  Created by puman on 2017/1/5.
//  Copyright © 2017年 mazegong. All rights reserved.
//

#import "RMMPayJieGuoViewController.h"

@interface RMMPayJieGuoViewController ()

@end

@implementation RMMPayJieGuoViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"交易结果";
    self.view.backgroundColor = kCColor;
    [self addViews];
    // Do any additional setup after loading the view.
}
- (void)addViews{
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:(UIBarButtonItemStylePlain) target:self action:nil];
    UIButton *button = [UIButton buttonWithType:(UIButtonTypeCustom)];
    button.frame = CGRectMake(0, 0, kScreenWideth, 54);
    [button setImage:[UIImage imageNamed:@"选中@3x"] forState:(UIControlStateNormal)];
    [button setTitle:@"支付成功" forState:(UIControlStateNormal)];
    [button setTitleColor:COLORFROMCODE(0x9B9B9B, 1) forState:(UIControlStateNormal)];
    [self.view addSubview:button];
    
    UIView *backView = [[UIView alloc] initWithFrame:CGRectMake(15, button.bottom, kScreenWideth - 30, 120)];
    backView.layer.masksToBounds = YES;
    backView.layer.cornerRadius = 5;
    backView.backgroundColor = kWhiteColor;
    [self.view addSubview:backView];
    
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, backView.width, 50)];
    label.font = kFont(14);
    label.textColor = COLORFROMCODE(0x9B9B9B, 1);
    label.textAlignment = NSTextAlignmentCenter;
    label.text = [NSString stringWithFormat:@"%@实付金额",_nameTitle];
    [backView addSubview:label];
    
    UILabel *labelPrice = [[UILabel alloc] initWithFrame:CGRectMake(0, label.bottom, backView.width, 70)];
    labelPrice.font = kFont(28);
    labelPrice.text = [NSString stringWithFormat:@"¥%@",_balance];
    labelPrice.textAlignment = NSTextAlignmentCenter;
    [backView addSubview:labelPrice];

    
    UIButton *bottomBut = [UIButton buttonWithType:(UIButtonTypeCustom)];
    bottomBut.frame = CGRectMake(kScreenWideth / 2 - 150, backView.bottom + 22, 300, 40);
    [bottomBut setTitle:@"完成" forState:(UIControlStateNormal)];
    [bottomBut setTitleColor:kWhiteColor forState:(UIControlStateNormal)];
    bottomBut.layer.cornerRadius = 20;
    bottomBut.backgroundColor = kBasicColor;
    BUTTON_S(bottomBut, doneBut);
    [self.view addSubview:bottomBut];
}
- (void)doneBut{
    [self.navigationController popToRootViewControllerAnimated:YES];
    NS_POST(@"SHOPFRESH", nil, nil);
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
